package com.bsj.power.system.config.interceptor;

import cn.dev33.satoken.interceptor.SaInterceptor;
import cn.dev33.satoken.router.SaRouter;
import cn.dev33.satoken.stp.StpUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.Ordered;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author yinhao
 * @version 1.0
 * @description 开放接口拦截
 * @date 2024/7/10
 */

@Configuration
public class OpenParamConfigure implements WebMvcConfigurer, Ordered {

    @Autowired
    private OpenParamInterceptor openParamInterceptor;

    /**
     * 保证此配置类在config包之后
     * @return
     */
    @Override
    public int getOrder() {
        return 1;
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(openParamInterceptor);
    }
}
